<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableUsers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id')->comment('主键ID');
            $table->string('phone',16)->default('')->comment('手机号码');
            $table->string('email',64)->default('')->comment('邮箱');
            $table->string('password')->default('')->comment('密码');
            $table->enum('status',[0,1])->default(1)->comment('状态','禁用','激活');
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();

            $table->unique(['email','password'],'name_password');
            $table->unique(['phone','password'],'email_password');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('users');
    }
}
